/**
 * 项目示例-列表综合搜索
 * Date 2023-5-25 09:33:56
 * {
 *   label: '', 筛选项名称
 *   prop: '', 筛选项字段
 *   type: '', 组件类型（'input' | 'select' | 'inputNumber' | 'cascader' | 'datePicker' | 'timePicker' | 'timeSelect' | 'treeSelect' | 'checkbox'）
 *   defaultValue: '', 筛选项默认值（不写默认undefined）
 *   inputProps: {}, 过滤组件属性，跟`ElementPlus`对应组件的`#Attributes`相同
 *   events: {} 仅支持change事件
 * }
 */
import type { FilterItem } from '@/components/FilterBar/types'
import { ref } from 'vue'

export const exampleOptions = ref<Array<FilterItem>>([
  {
    label: '设备类型', // 后续由接口获取下拉数据
    prop: 'typeId',
    type: 'treeSelect',
    span: 4.2,
    inputProps: {
      'default-expand-all': true,
      data: []
    }
  },
  {
    label: '问题类型',
    prop: 'problemType',
    type: 'input',
    span: 4.2,
    inputProps: {
      clearable: true,
      placeholder: '请输入问题类型'
    }
  },
  {
    label: '所属单位',
    prop: 'tree',
    type: 'treeSelect',
    span:  4.2,
    inputProps: {
      'default-expand-all': true,
      data: []
    }
  },
    {
      label: '时间',
      prop: 'date1',
      type: 'datePicker',
      span: 7,
      defaultValue: [],
      inputProps: {
        type: 'datetimerange',
        format: 'YYYY-MM-DD HH:mm',
        'value-format': 'YYYY-MM-DD HH:mm',
        'start-placeholder': '开始时间',
        'end-placeholder': '结束时间',
        'range-separator': '至'
      }
    }
])
export const dialogOptions: FilterItem[] = [
  {
    label: '设备类型', // 后续由接口获取下拉数据
    prop: 'device',
    type: 'select',
    span: 24,
    defaultValue: '',
    inputProps: {
      options: [
        { label: '全部', value: '' }
      ]
    }
  },
  {
    label: '问题类型',
    prop: 'problem',
    type: 'input',
    span: 24,
    inputProps: {
      clearable: true,
      placeholder: '请输入问题类型'
    }
  },
  {
    label: '所属单位',
    prop: 'tree',
    type: 'treeSelect',
    span: 24,
    inputProps: {
      'default-expand-all': true,
      data: [{
        value: '1',
        label: 'Level one 1',
        children: [
          {
            value: '1-1',
            label: 'Level two 1-1'
          }
        ]
      }]
    }
  }
]
export const dialogEditOptions: FilterItem[] = [
  {
    label: '设备类型', // 后续由接口获取下拉数据
    prop: 'project',
    type: 'input',
    span: 24,
    isDisabled: true,
    defaultValue: '',
    inputProps: {
      placeholder: '请输入设备类型'
    }
  },
  {
    label: '问题类型',
    prop: 'problemType',
    type: 'input',
    span: 24,
    defaultValue: '',
    inputProps: {
      clearable: true,
      placeholder: '请输入问题类型'
    }
  },
  {
    label: '所属单位',
    prop: 'organ',
    type: 'treeSelect',
    span: 24,
    isDisabled: true,
    inputProps: {
      clearable: true,
      placeholder: '请输入所属单位'
    }
  },
  {
    label: ' 创 建 人 ',
    prop: 'creator',
    type: 'input',
    span: 24,
    isDisabled: true,
    inputProps: {
      clearable: true,
      placeholder: '请输入创建人'
    }
  },
  {
    label: '创建时间',
    prop: 'createTime',
    type: 'input',
    span: 24,
    isDisabled: true,
    inputProps: {
      clearable: true,
      placeholder: '请输入创建时间'
    }
  }
]
